//---------------------------------------------------------------------------
#ifndef MyINIManagerH
#define MyINIManagerH
#include "MyUtility.h"
//---------------------------------------------------------------------------
#ifdef MY_BORLAND
#include <SysUtils.hpp>
#include <Classes.hpp>
#endif
#include <stdio.h>
#include <list>
#include <iostream>
using namespace std;
#define MYINIMGR_VER10		0x10
//---------------------------------------------------------------------------
typedef struct{
	char *Key;
	char *Value;
}KeyItem;
//---------------------------------------------------------------------------
#ifdef MY_BORLAND
class PACKAGE MyIniManager
#else
class MyIniManager
#endif
{
private:
	char *FFileName;
	wchar_t*	char_to_wchar(char* Input);
	char* wchar_to_char(wchar_t* Input);
protected:
#ifdef MY_BORLAND
	int GetVersion();
#endif	
public:
	void DeleteKey(char *Section, char *Key);
	void DeleteSection(char *Section);
	char* ReadString(char* szSection, char* szKey, const char* szDefaultValue);
	bool ReadBool(char* szSection, char* szKey, bool bolDefaultValue);
	int ReadInteger(char* szSection, char* szKey, int iDefaultValue);
	int ReadHex(char* szSection, char* szKey, int iDefaultValue);
	void WriteBool(char* szSection, char* szKey, bool bolValue);
	void WriteString(char* szSection, char* szKey, char* szValue);
	void WriteInteger(char* szSection, char* szKey, int iValue);
	void WriteHex(char* szSection, char* szKey, int iValue);
	MyIniManager(char *FileName);
	list <char*> GetSectionNames();		//size
	list <KeyItem*> GetSectionKeys(char *Section);
#ifdef MY_BORLAND	
	__property int Version = {read = GetVersion};
#else	
	int GetVersion();
#endif	
};
//---------------------------------------------------------------------------
#endif
